import { AppRouteRecordRaw } from '@/types/route'
import { shallowRef } from 'vue'
import Layout from '@/layout/index.vue'

export let menuRouter: AppRouteRecordRaw = {
  path: '/menu',
  name: 'menu',
  component: shallowRef(Layout),
  meta: {
    title: '多级菜单',
    icon: 'icon-shouye_icon'
  },
  children: [
    {
      path: '/menu/menu1',
      component: () => import(/* webpackChunkName: "home" */ '@/views/home/index.vue'),
      name: 'menu1',
      meta: { title: '菜单一' },
      children: [
        {
          path: '/menu/menu1/menu2',
          component: () => import(/* webpackChunkName: "home" */ '@/views/home/index.vue'),
          name: 'menu2',
          meta: { title: '菜单二' }
        }
      ]
    },
    {
      path: '/menu/menu3',
      component: () => import(/* webpackChunkName: "home" */ '@/views/home/index.vue'),
      name: 'menu3',
      meta: { title: '菜单一' }
    }
  ]
}

export default menuRouter
